﻿<%@ Page CodeFileBaseClass="AliCMS.Lib.SystemPageBase" %>
<ali:Get ID="Candidate" Object="InstanceConfig" Operation="GetLanguageSettings()" />
<script language="c#" runat="server">
protected bool Exists(object ab)
{
	foreach (DataRow row in Manager.Languages.Rows)
	{
		if (String.Equals(ab, row[Alias.Language.Ab]))
			return true;
	}
	
	return false;
}
</script>
<section data-page="language_add" data-title="添加语言" data-lang="<%=ContentLang%>">
	<dl class="path1">
		<dt><span>您的位置：</span>添加语言</dt>
		<dd>
			<select data-class="<%=ContentLang%>Font" data-ali-widget="combo">
				<ali:List Object="Language" Source="Manager.Languages">
					<ali:Record>
						<%If Convert.ToString(Ab) == ContentLang%>
							<option value="<%=Ab%>" selected><%=[AliCMS.SystemModule.Alias.Language.Name + PageLang]%></option>
						<%Else%>
							<option value="<%=Ab%>"><%=[AliCMS.SystemModule.Alias.Language.Name + PageLang]%></option>
						<%EndIf%>
					</ali:Record>
				</ali:List>
			</select>
		</dd>
	</dl>
	<form action="" class="post">
		<div class="post-body">
			<div class="ali-tabs" data-event="click">
				<div class="ali-tabs-header">
					<div class="ali-tabs-nav-container">
						<ul>
							<li><a href="list.aspx?Lang=<%=ContentLang%>" target="ali-navtab">语言列表</a></li>
							<li class="ali-active"><a>添加语言</a></li>
						</ul>				
					</div>
				</div>
				<div class="ali-tabs-body">
					<div class="ali-tabs-panel"></div>
					<div class="ali-tabs-panel">
						<table class="post-table margin2">
							<tr>
								<th>备选项：</th>
								<td>
									<select data-name="Candidate" data-class="<%=ContentLang%>Font"  data-ali-widget="combo">
										<option>-- 请选择 --</option>
										<ali:List Object="Language" Source="Candidate">
											<ali:Record>
												<%If !Exists(Ab)%>
													<option value="<%=ID%>|<%=Name%>|<%=Ab%>|<%=Direction%>|<%=FontFamily%>|<%=Eot%>"><%=Name%></option>
												<%EndIf%>
											</ali:Record>
										</ali:List>
									</select>
								</td>
							</tr>
							<tr>
								<th>名称：</th>
								<td><input type="text" name="Name" size="50" maxlength="50" class="ali-input <%=ContentLang%>Font"></td>
							</tr>
							<tr>
								<th>缩写：</th>
								<td><input type="text" name="Ab" size="3" maxlength="3" class="ali-input <%=ContentLang%>Font"></td>
							</tr>
							<tr>
								<th>方向：</th>
								<td>
									<select name="Direction" data-class="<%=ContentLang%>Font" data-ali-widget="combo">
										<option value="ltr">从左向右</option>
										<option value="rtl">从右向左</option>
									</select>
								</td>
							</tr>
							<tr>
								<th>字体：</th>
								<td><input type="text" name="FontFamily" size="50" class="ali-input <%=ContentLang%>Font"></td>
							</tr>
							<tr>
								<th>Eot：</th>
								<td><input type="text" name="Eot" class="ali-input <%=ContentLang%>Font">可以使用{#WebPath#}表示网站根目录</td>
							</tr>
						</table>
					</div>
				</div>
				<div class="ali-tabs-bottom"><b></b></div>
			</div>
		</div>
		<div class="post-footer"><button type="submit" class="ali-button">添 加</button></div>
	</form>
</section>